/* GUI CONVERTED from eccyck.i (converter v1.76) Thu Apr 25 18:57:06 2002 */
/* eccyck.i  - ECN CYCLIC STRUCTURE CHECK                                     */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Revision: 1.3 $                                                           */
/*V8:ConvertMode=Maintenance                                                  */
/* REVISION: 8.5      CREATED: 06/21/99     BY: *J3H5* Jyoti Thatte           */
/* REVISION: 9.1     MODIFIED: 08/14/00     BY: *N0KW* Jacolyn Neder          */
/* $Revision: 1.3 $    BY: Jean Miller           DATE: 04/12/02  ECO: *P05H*  */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

/*! THIS INCLUDE FILE  CALLS BMPSMTA.P AND PERFORMS THE CYCLIC PRODUCT
    STRUCTURE CHECK. IT ADDS THE TEMPORARY RECORDS IF THE RECORDS ARE
    NOT FOUND AND DELETES THE PRODUCT STRUCTURE RECORDS IF IT WAS ADDED.*/

PROCEDURE cyclic_check:
   define input  parameter l_par  like ecd1_par  no-undo.
   define input  parameter l_comp like ecd1_comp no-undo.
   define input  parameter l_ref  like ecd1_ref  no-undo.
   define output parameter ps_ok  like mfc_logical initial yes no-undo.

   for first ps_mstr
   fields(ps_par ps_comp ps_ref)
      where ps_par  = l_par and
            ps_comp = l_comp and
            ps_ref  = l_ref
   no-lock: end.

   if not available ps_mstr then do:
      create ps_mstr.
      assign
         ps_par  = l_par
         ps_comp = l_comp
         ps_ref  = l_ref.
   end. /* IF NOT AVAILABLE */

   ps_recno = recid(ps_mstr).

   /* CHECK FOR CYCLIC PRODUCT STRUCTURES */
   {gprun.i ""bmpsmta.p""}
/*GUI*/ if global-beam-me-up then undo, leave.


   if ps_recno = 0 then do:
      ps_ok = no.
      undo, leave.
   end. /* IF PS_RECNO = 0 */

   else do:
      undo, next.
   end. /* ELSE DO */

END PROCEDURE.
